package com.admin.service.impl;

import com.admin.mapper.UserMapper;
import com.admin.pojo.Users;
import com.admin.service.UserService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    public UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public List<Users> selectAll(Map<String,Object> queryMap, int currentPage, int pageSize) {
        PageHelper.startPage(currentPage, pageSize);
        List<Users> list = userMapper.selectAll();
        PageInfo<Users> pi=new PageInfo<>(list);
        return pi.getList();
    }
}
